import { ref } from 'vue'
import { PageContent } from '@/components/page-content'
import { PageFilter } from '@/components/page-search'

export function usePageFilter() {
  const pageContentRef = ref<InstanceType<typeof PageContent>>()
  const pageFilterRef = ref<InstanceType<typeof PageFilter>>()
  const handleResetClick = () => {
    console.log('usePageFilter hooks', pageFilterRef.value)
    pageContentRef.value?.getPageData()
    pageFilterRef.value.dialogVisible = false
  }
  const handleQueryClick = (queryInfo: any) => {
    console.log('1111')
    console.log(queryInfo)
    console.log(pageContentRef.value)
    pageContentRef.value?.getPageData(queryInfo)
    pageFilterRef.value.dialogVisible = false
  }

  return { pageFilterRef, pageContentRef, handleResetClick, handleQueryClick }
}
